package com.access.boot.autoconfigure.apisdk.proxy.aop;

import com.access.boot.apisdk.SdkManager;
import com.access.boot.autoconfigure.apisdk.proxy.OpenApiEnhance;
import lombok.extern.slf4j.Slf4j;

/**
 * @author Yangzhen
 * @date 2022/5/30 23:55
 * @since 1.0.0
 */
@Slf4j
public class EnhanceProxyInstance {

    // 开放接口真正增强的执行对象
    private OpenApiEnhance openApiEnhance;

    // javassist 增强后的代理对象
    private Object proxyBean;

    public EnhanceProxyInstance(Class openApiInterface) {
        this.openApiEnhance = new OpenApiEnhance(openApiInterface);
        proxyBean = SdkManager.get(this.openApiEnhance.getEnhanceInterface());
    }

    public OpenApiEnhance getOpenApiEnhance() {
        return openApiEnhance;
    }

    public Object getProxyBean() {
        return proxyBean;
    }
}
